<?php
$this->breadcrumbs=array(
	'Banks',
);?>
<div class="section">

<?php foreach(Yii::app()->user->getFlashes() as $key => $message) :
    $class = 'messages ';
    $switch = explode('_', $key);
    $switch = $switch[0];
    switch ($switch){
        case 'suc':
            $class.= 'green';
        break;
        case 'fail':
            $class.= 'red';
        break;
        default:
            $class.= 'blue';
        break;
    } ?>
    <br/>
    <br/>
    <div class="<?= $class?>" title="Клик, чтобы скрыть" onclick="$(this).fadeOut();" style="cursor:pointer;float:left;clear: both;padding-right: 10px;">
        <span></span>
        <?= $message;?> 
    </div>    
<?php endforeach ?>

        <div class="box">
            <div class="title">
                <h2><?=Yii::t('app', $model->title.'. Список измененных полей')?></h2>
                <span class="hide"></span>
            </div>
<div class="content">
<br/><br/>
<?=CHtml::beginForm(); ?>
<table cellspacing="0" cellpadding="0" border="0" class="table-all">
                    <thead> 
                        <tr> 
                            <th><input type="checkbox" name="check" class="checkall"></th>
                            <th class="header"><?=Yii::t('app','Название поля')?></th>
                            <th class="header"><?=Yii::t('app','Текущее значение')?></th>
                            <th class="header"><?=Yii::t('app','Значение для модерации')?></th>
                        </tr> 
                    </thead>
                    <tbody>
<? 
$i = 0;
//CVarDumper::dump($model->attributes);
foreach($model->attributes as $key => $value):
//var_dump($key); echo '=>'; var_dump($value); echo '<br>';
    $i++;
    $rowClass = ($i % 2 == 0)?'even':'odd';
    if ($model->getAttribute($key) != $pre->getAttribute($key)):
    ?>
    <tr class="<?= $rowClass ?>">
        <td><input type="checkbox" name="check[<?=$key?>]"></td>
        <td><?php echo $model->getAttributeLabel($key) ?></td>
        <? if ($key == 'logo'): ?>
            <td><img src="<?php echo $model->getAttribute($key) ?>" width="100px" height="100px" /></td>
            <td><img src="<?php echo $pre->getAttribute($key) ?>"  width="100px" height="100px" /></td>
        <? else: ?>
            <td><?php echo $model->getAttribute($key) ?></td>
            <td><?php echo $pre->getAttribute($key) ?></td>
        <? endif ?>
    </tr>
    <?endif?>
<?endforeach?>
</tbody>
</table>
                <div id="pager" class="pager">

                        <button type="submit" name="allow" class="green"><span><?=Yii::t('app','Принять выбранное');?></span></button>
                        <button type="submit" name="decline" class="red"><span><?=Yii::t('app','Отклонить выбранное');?></span></button>
                        <div>
                            <img src="<?= Yii::app()->theme->baseUrl ?>/gfx/table-first.gif" class="first" alt="First">
                            <img src="<?= Yii::app()->theme->baseUrl ?>/gfx/table-prev.gif" class="prev" alt="Previous">
                            <input type="text" class="pagedisplay">
                            <img src="<?= Yii::app()->theme->baseUrl ?>/gfx/table-next.gif" class="next" alt="Next">
                            <img src="<?= Yii::app()->theme->baseUrl ?>/gfx/table-last.gif" class="last" alt="Last">
                        </div>

                            <select class="pagesize" tabindex="-1">
                                                    <option value="5">5</option>
                                                    <option value="10">10</option>
                                                    <option value="25">25</option>
                                                    <option selected="selected" value="50">50</option>
                                                </select>
                       
                        <?=CHtml::endForm(); ?>
</div>
</div>
</div>
